Skip to main content

All Questions

Tagged with
1vote
1answer
602views

Update a server-side render Block when woocommerce cart block changed

I am currently developing a small block for WordPress/WooCommerce and now I have a problem that I can't solve easily. To summarize: I am looking for a way to update my block in the frontend when ...
HackePeter's user avatar
1vote
0answers
94views

Ajax load more post button not showing

I have some alpine.js and ajax that is loading wordpress posts on click of a button, this is working well. however I am now trying to add some code to the button to hide if no post available to load, ...
Beep's user avatar
1vote
2answers
115views

Post current post type to my Ajax

I have two files, alpine js and a ajax, i want to get my current post type from wordpress with $post_type = get_post_type( $post->ID ); $postType = get_queried_object(); $args = array( '...
Beep's user avatar
0votes
0answers
247views

Embedded data and the _fields parameter in getEntityRecords

I'm using the following code to retrieve a list of post of a custom post type named movie: const { posts, hasPostsResolved } = useSelect(select => { const query = { order: 'desc', ...
leemon's user avatar
  • 2,032
0votes
0answers
280views

REST API not returning all tags - is there a way to return all tags even ones that are not part of published posts?

I am using the REST API to upload posts and I include tags with them. I get existing tags and check them to ensure I am not trying to upload a duplicate tag. However, the new posts are uploaded in ...
MattE's user avatar
0votes
0answers
271views

WordPress REST API and Backbone JS

I am trying to learn WordPress Rest API using Backbone.js the official library, there aren't many tutorials, and that's why I am asking this question right here. First question is why when I add WP-...
Kristijan Pirkovic's user avatar
0votes
1answer
845views

Registered a REST Route but I’m Getting a 400 Bad Request

I'm new to this so please bare with me. I'm trying to register a REST route to save the dynamically added custom fields of a custom post along with the post when the user clicks the "Update" ...
Samuel Bacay's user avatar
0votes
1answer
40views

How to submit a button automatically after every scheduled hours?

How to submit a button automatically after every scheduled hours ? I tried some JavaScript but all failed. What I am doing? I am trying to fetch product categories from an external API Why I want ...
Ricky's user avatar
0votes
2answers
508views

Get Comment Text via REST API

Added Note that this process is in a WP plugin, using thw WP API, so I believe this is appropriate for this SO and should not be closed. The following REST call is used to get a specific comment: var ...
Rick Hellewell's user avatar
0votes
1answer
756views

WP Rest API feature image breaking react component

I have a react app which displays posts by using the WP Rest APi. To display, I'm using map() to loop through the posts. {posts.map((articles, i) => { return ( &...
rikardo85's user avatar
1vote
1answer
2kviews

WP REST API - "rest_user_cannot_view" ONLY on specific users

so upon requesting users through REST API - I get the code "rest_user_cannot_view" message "Sorry, you are not allowed to list users." data status 401 for example https://...
Robert Hošták's user avatar
0votes
1answer
733views

WordPress REST API response is empty in browser and script, but not in Postman

I'm trying to do a super simple fetch to grab some user data for my WP site. This URL works 100% in Postman and I get everything I need. However, in the browser and script, the response is ALWAYS an ...
lz430's user avatar
1vote
1answer
1kviews

Very simple wordpress block to display posts from an api call

I've been banging my head on this for a bit now. I'm trying to create a simple wordpress block that fetches custom post types from the rest api, then displays the fetched posts via react. It only ...
elliott_l's user avatar
0votes
0answers
246views

Wordpress Rest Api access the header and extract stylesheets URL

Good morning, i have just started to see in depth the WordPress API and the use of the fetch function in javascript and i would like to know if there is the possibility to get the url of the ...
Dario B.'s user avatar
0votes
0answers
67views

Check if user can in javascript

Using the rest API I retrieve a collection of posts: const recordsParams = {} const recordsCollection = new wp.api.collections.MyPostType(); recordsCollection.fetch( { data: recordsParams } ) ....
Laurent's user avatar

153050per page
close